#ifndef __DL_EH__
#define __DL_EH__
#include <stdint.h>
#include "IO_LINK_Global_Param.h"
typedef enum{
  EH_Inactive_0,
  EH_Idle_1,
  subEH_Idle_1,//自定义子状态
  EH_ReadEvent_2,
  subEH_ReadEvent_2,//自定义子状态
  EH_SignalEvent_3,
  EH_EventConfirmation_4,
  subEH_EventConfirmation_4
}EH_STATE_TYPE;

 
typedef struct{
  uint8_t Instance;
  uint8_t Type;
  uint8_t Mode;
  uint16_t EventCode;
 
}EH_EventInfo_Typedef;

typedef struct{
  uint8_t EventQualifer;
  uint16_t EventCode;
}EventMemory_Slot_Typedef;

 


extern EH_STATE_TYPE EH_STATE[PORT_NUM];


void  Init_EH(void);
void Event_EH_Conf_ACTIVE(uint8_t Port);
void Event_EH_Conf_INACTIVE(uint8_t Port);

void Event_EventTrig(uint8_t Port);
void Event_DL_EventConf(uint8_t Port);

void Event_Events_completed(uint8_t Port);
void Event_Events_reported(uint8_t Port);


void DL_EH_T2(uint8_t Port);

//收到EventStatus后解析，判断Error有几条()，每条地址
void DL_EH_T2_1(uint8_t Port);
void DL_EH_T3(uint8_t Port);

//提取EventCode
void DL_EH_T3_1(uint8_t Port);
void DL_EH_T4(uint8_t Port);
void DL_EH_T8(uint8_t Port);
#endif



